package com.whty.mongodemo.route;

import com.whty.mongodemo.handler.CustomFormHandler;
import io.vertx.ext.web.Router;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CustomForm {

  private final CustomFormHandler handler = new CustomFormHandler();

  private final static String prefix = "/customForm";

  public void init(Router router) {
    router.get(prefix + "/queryById/:id").handler(handler.queryById());
    router.post(prefix + "/query").handler(handler.query());
    router.post(prefix + "/queryByPage").handler(handler.queryByPage());
    router.post(prefix + "/insert").handler(handler.insert());
    router.put(prefix + "/update").handler(handler.update());
    router.delete(prefix + "/remove/:id").handler(handler.remove());
    router.post(prefix + "/queryWithChildren").handler(handler.queryWithChildren());
  }
}
